import { Root } from "../../../../Core/Module/Entity/Root";
import { AEvent } from "../../../../Core/Module/EventSystem/IEvent";
import { EventAttribute } from "../../../../Decorator/Decorator";
import { ETTask } from "../../../../Support/Share/Lib/Async/ETTask";
import { EntryEventType } from "../../../Model/Share/Entry";
import { AIDispatcherComponent } from "../../../Model/Share/Module/AI/AIDispatcherComponent";
import { MessageDispatcherComponent } from "../../../Model/Share/Module/Message/MessageDispatcherComponent";
import { NetThreadComponent } from "../../../Model/Share/Module/Message/NetThreadComponent";
import { OpcodeTypeComponent } from "../../../Model/Share/Module/Message/OpcodeTypeComponent";
import { NumericWatcherComponent } from "../../../Model/Share/Module/Numeric/NumericWatcherComponent";
import { ClientSceneManagerComponent } from "../../../Model/Share/Module/Scene/ClientSceneManagerComponent";

@EventAttribute(EntryEventType.EntryEvent1)
export class EntryEvent1_InitShare extends AEvent<EntryEventType.EntryEvent1> {

    async Run(a: EntryEventType.EntryEvent1) {
        Root.Instance.Scene.AddComponent<NetThreadComponent>(NetThreadComponent);
        Root.Instance.Scene.AddComponent<OpcodeTypeComponent>(OpcodeTypeComponent);
        Root.Instance.Scene.AddComponent<MessageDispatcherComponent>(MessageDispatcherComponent);
        Root.Instance.Scene.AddComponent<NumericWatcherComponent>(NumericWatcherComponent);
        Root.Instance.Scene.AddComponent<AIDispatcherComponent>(AIDispatcherComponent);
        Root.Instance.Scene.AddComponent<ClientSceneManagerComponent>(ClientSceneManagerComponent);

        await ETTask.CompletedTask;
    }

}